package com.ygqh.baby.model.wdt.qyb;

import java.lang.reflect.Field;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.annotation.JSONField;
import com.ygqh.baby.utils.DateConvertUtils;

/**
 * 企业版创建原始订单原型
 * 
 * @author admin
 *
 */
public class WdtQybOrderReq {
	/**
	 * 平台订单编号
	 */
	@JSONField(name = "tid")
	private String tid;

	/**
	 * 订单推送状态: 10未确认(等待付款的订单,cod订单不需要等付款，直接进行待发货) 20待尾款(部分付款的订单,要等尾款付完再发货)
	 * 30已付款待发货(包含货到付款) 40部分发货(拆分发货才会出现) 50已发货(平台上订单状态已经发货) 60已签收 70已完成
	 * 80已退款(付过款后来全部退款了) 90已关闭(未付款直接取消的订单)订单可修改状态：30 =》60 /70/
	 * 80，只可以从30状态改变成这3种状态。
	 */
	@JSONField(name = "trade_status")
	private int tradeStatus;

	/**
	 * 发货条件:1款到发货 2货到付款(包含部分货到付款) 3分期付款
	 */
	@JSONField(name = "delivery_term")
	private int deliveryTerm;

	/**
	 * 付款状态:0未付款1部分付款2已付款
	 */
	@JSONField(name = "pay_status")
	private String payStatus;

	/**
	 * 下单时间,格式: YYYY-MM-DD HH:MM:SS
	 */
	@JSONField(name = "trade_time")
	private String tradeTime;

	/**
	 * 付款时间,格式如上. 未付款订单为:0000-00-00 00:00:00
	 */
	@JSONField(name = "pay_time")
	private String payTime;

	/**
	 * 买家昵称
	 */
	@JSONField(name = "buyer_nick")
	private String buyerNick;

	/**
	 * 买家email
	 */
	@JSONField(name = "buyer_email")
	private String buyerEmail;

	/**
	 * 支付单号
	 */
	@JSONField(name = "pay_id")
	private String payId;

	/**
	 * 支付账号
	 */
	@JSONField(name = "pay_account")
	private String payAccount;

	/**
	 * 收件人姓名
	 */
	@JSONField(name = "receiver_name")
	private String receiverName;

	/**
	 * 收件人省份
	 */
	@JSONField(name = "receiver_province")
	private String receiverProvince;

	/**
	 * 收件城市
	 */
	@JSONField(name = "receiver_city")
	private String receiverCity;

	/**
	 * 收件人区县
	 */
	@JSONField(name = "receiver_district")
	private String receiverDistrict;

	/**
	 * 收件人地址
	 */
	@JSONField(name = "receiver_address")
	private String receiverAddress;

	/**
	 * 收件人手机
	 */
	@JSONField(name = "receiver_mobile")
	private String receiverMobile;

	/**
	 * 收件人电话
	 */
	@JSONField(name = "receiver_telno")
	private String receiverTelno;

	/**
	 * 收件人邮编
	 */
	@JSONField(name = "receiver_zip")
	private String receiverZip;

	/**
	 * 物流方式，-1表示自由选择，2平邮 3EMS
	 */
	@JSONField(name = "logistics_type")
	private String logisticsType;
	/**
	 * 是否需要发票,0 不需要，1需要 2增值税发票
	 */
	@JSONField(name = "invoice_type")
	private String invoiceType;

	/**
	 * 发票抬头
	 */
	@JSONField(name = "invoice_title")
	private String invoiceTitle;
	/**
	 * 发票内容
	 */
	@JSONField(name = "invoice_content")
	private String invoiceContent;

	/**
	 * 买家备注
	 */
	@JSONField(name = "buyer_message")
	private String buyerMessage;

	/**
	 * 客服备注
	 */
	@JSONField(name = "seller_memo")
	private String sellerMemo;

	/**
	 * 客服标旗(取值0-5)
	 */
	@JSONField(name = "seller_flag")
	private String sellerFlag;

	/**
	 * 邮费
	 */
	@JSONField(name = "post_amount")
	private String postAmount;

	/**
	 * 货到付款金额
	 */
	@JSONField(name = "cod_amount")
	private String codAmount;

	/**
	 * 货到付款买家费用，这个钱卖家收不回来，是收快递公司直接收走，但在快递单是要打印出来，否则快递收款就错了
	 */
	@JSONField(name = "ext_cod_fee")
	private String extCodFee;
	/**
	 * 其它应从买家收取的服务费，其他费用
	 */
	@JSONField(name = "other_amount")
	private String otherAmount;

	/**
	 * 已付金额
	 */
	@JSONField(name = "paid")
	private String paid;

	/**
	 * 证件类型 1 身份证
	 */
	@JSONField(name = "id_card_type")
	private String id_card_type;

	/**
	 * 证件号码
	 */
	@JSONField(name = "id_card")
	private String id_card;

	/**
	 * 自定义字段（不传入订单）
	 */
	@JSONField(name = "cust_data")
	private String cust_data;

	@JSONField(name = "order_list")
	private List<WdtQybOrderLstReq> orderList;

	public Map<String, Object> toMap() {
		Map<String, Object> map = new HashMap<String, Object>();
		Field[] fields = this.getClass().getDeclaredFields();
		for (Field field : fields) {
			Object obj;
			try {
				obj = field.get(this);
				if (obj != null) {
					map.put(field.getName(), obj);
				}
			} catch (IllegalArgumentException e) {
				e.printStackTrace();
			} catch (IllegalAccessException e) {
				e.printStackTrace();
			}
		}
		return map;
	}

	public WdtQybOrderReq() {
		super();
	}

	/**
	 * 
	 * @Title:
	 * @Description: 创建原始订单构造函数
	 * @param tid
	 *            订单编号
	 * @param tradeStatus
	 *            订单状态
	 * @param deliveryTerm
	 *            发货条件:1款到发货 2货到付款(包含部分货到付款) 3分期付款
	 * @param payStatus
	 *            付款状态:0未付款1部分付款2已付款
	 * @param receiverName
	 * @param receiverProvince
	 * @param receiverCity
	 * @param receiverDistrict
	 * @param receiverAddress
	 * @param logisticsType
	 *            物流方式，-1表示自由选择，2平邮 3EMS
	 * @param postAmount
	 *            邮费
	 * @param codAmount
	 *            货到付款金额
	 * @param extCodFee
	 *            货到付款买家费用，这个钱卖家收不回来，是收快递公司直接收走，但在快递单是要打印出来，否则快递收款就错了
	 * @param otherAmount
	 *            其它应从买家收取的服务费，其他费用
	 * @param paid
	 *            已付金额
	 * @param orderList
	 *            入参
	 */
	public WdtQybOrderReq(String tid, int tradeStatus, int deliveryTerm, String payStatus, String receiverName, String receiverProvince, String receiverCity,
			String receiverDistrict, String receiverAddress, String logisticsType, String postAmount, String codAmount, String extCodFee, String otherAmount,
			String paid, List<WdtQybOrderLstReq> orderList) {
		super();
		this.tid = tid;
		this.buyerNick = receiverName;
		this.tradeStatus = tradeStatus;
		this.deliveryTerm = deliveryTerm;
		this.payStatus = payStatus;
		this.receiverName = receiverName;
		this.receiverProvince = receiverProvince;
		this.receiverCity = receiverCity;
		this.receiverDistrict = receiverDistrict;
		this.receiverAddress = receiverAddress;
		this.logisticsType = logisticsType;
		this.postAmount = postAmount;
		this.codAmount = codAmount;
		this.extCodFee = extCodFee;
		this.otherAmount = otherAmount;
		this.paid = paid;
		this.orderList = orderList;
	}

	public String getTid() {
		return tid;
	}

	public void setTid(String tid) {
		this.tid = tid;
	}

	public int getTradeStatus() {
		return tradeStatus;
	}

	public void setTradeStatus(int tradeStatus) {
		this.tradeStatus = tradeStatus;
	}

	public int getDeliveryTerm() {
		return deliveryTerm;
	}

	public void setDeliveryTerm(int deliveryTerm) {
		this.deliveryTerm = deliveryTerm;
	}

	public String getPayStatus() {
		return payStatus;
	}

	public void setPayStatus(String payStatus) {
		this.payStatus = payStatus;
	}

	public String getTradeTime() {
		return tradeTime;
	}

	public void setTradeTime(Date tradeTime) {
		this.tradeTime = DateConvertUtils.formatDateTime(tradeTime);
	}

	public String getPayTime() {
		return payTime;
	}

	public void setPayTime(Date payTime) {
		this.payTime = DateConvertUtils.formatDateTime(payTime);
	}

	public String getBuyerNick() {
		return buyerNick;
	}

	public void setBuyerNick(String buyerNick) {
		this.buyerNick = buyerNick;
	}

	public String getBuyerEmail() {
		return buyerEmail;
	}

	public void setBuyerEmail(String buyerEmail) {
		this.buyerEmail = buyerEmail;
	}

	public String getPayId() {
		return payId;
	}

	public void setPayId(String payId) {
		this.payId = payId;
	}

	public String getPayAccount() {
		return payAccount;
	}

	public void setPayAccount(String payAccount) {
		this.payAccount = payAccount;
	}

	public String getReceiverName() {
		return receiverName;
	}

	public void setReceiverName(String receiverName) {
		this.receiverName = receiverName;
	}

	public String getReceiverProvince() {
		return receiverProvince;
	}

	public void setReceiverProvince(String receiverProvince) {
		this.receiverProvince = receiverProvince;
	}

	public String getReceiverCity() {
		return receiverCity;
	}

	public void setReceiverCity(String receiverCity) {
		this.receiverCity = receiverCity;
	}

	public String getReceiverDistrict() {
		return receiverDistrict;
	}

	public void setReceiverDistrict(String receiverDistrict) {
		this.receiverDistrict = receiverDistrict;
	}

	public String getReceiverAddress() {
		return receiverAddress;
	}

	public void setReceiverAddress(String receiverAddress) {
		this.receiverAddress = receiverAddress;
	}

	public String getReceiverMobile() {
		return receiverMobile;
	}

	public void setReceiverMobile(String receiverMobile) {
		this.receiverMobile = receiverMobile;
	}

	public String getReceiverTelno() {
		return receiverTelno;
	}

	public void setReceiverTelno(String receiverTelno) {
		this.receiverTelno = receiverTelno;
	}

	public String getReceiverZip() {
		return receiverZip;
	}

	public void setReceiverZip(String receiverZip) {
		this.receiverZip = receiverZip;
	}

	public String getLogisticsType() {
		return logisticsType;
	}

	public void setLogisticsType(String logisticsType) {
		this.logisticsType = logisticsType;
	}

	public String getInvoiceType() {
		return invoiceType;
	}

	public void setInvoiceType(String invoiceType) {
		this.invoiceType = invoiceType;
	}

	public String getInvoiceTitle() {
		return invoiceTitle;
	}

	public void setInvoiceTitle(String invoiceTitle) {
		this.invoiceTitle = invoiceTitle;
	}

	public String getInvoiceContent() {
		return invoiceContent;
	}

	public void setInvoiceContent(String invoiceContent) {
		this.invoiceContent = invoiceContent;
	}

	public String getBuyerMessage() {
		return buyerMessage;
	}

	public void setBuyerMessage(String buyerMessage) {
		this.buyerMessage = buyerMessage;
	}

	public String getSellerMemo() {
		return sellerMemo;
	}

	public void setSellerMemo(String sellerMemo) {
		this.sellerMemo = sellerMemo;
	}

	public String getSellerFlag() {
		return sellerFlag;
	}

	public void setSellerFlag(String sellerFlag) {
		this.sellerFlag = sellerFlag;
	}

	public String getPostAmount() {
		return postAmount;
	}

	public void setPostAmount(String postAmount) {
		this.postAmount = postAmount;
	}

	public String getCodAmount() {
		return codAmount;
	}

	public void setCodAmount(String codAmount) {
		this.codAmount = codAmount;
	}

	public String getExtCodFee() {
		return extCodFee;
	}

	public void setExtCodFee(String extCodFee) {
		this.extCodFee = extCodFee;
	}

	public String getOtherAmount() {
		return otherAmount;
	}

	public void setOtherAmount(String otherAmount) {
		this.otherAmount = otherAmount;
	}

	public String getPaid() {
		return paid;
	}

	public void setPaid(String paid) {
		this.paid = paid;
	}

	public String getId_card_type() {
		return id_card_type;
	}

	public void setId_card_type(String id_card_type) {
		this.id_card_type = id_card_type;
	}

	public String getId_card() {
		return id_card;
	}

	public void setId_card(String id_card) {
		this.id_card = id_card;
	}

	public String getCust_data() {
		return cust_data;
	}

	public void setCust_data(String cust_data) {
		this.cust_data = cust_data;
	}

	public List<WdtQybOrderLstReq> getOrderList() {
		return orderList;
	}

	public void setOrderList(List<WdtQybOrderLstReq> orderList) {
		this.orderList = orderList;
	}

	@Override
	public String toString() {
		return "WdtQybOrderReq [tid=" + tid + ", tradeStatus=" + tradeStatus + ", deliveryTerm=" + deliveryTerm + ", payStatus=" + payStatus + ", tradeTime="
				+ tradeTime + ", payTime=" + payTime + ", buyerNick=" + buyerNick + ", buyerEmail=" + buyerEmail + ", payId=" + payId + ", payAccount="
				+ payAccount + ", receiverName=" + receiverName + ", receiverProvince=" + receiverProvince + ", receiverCity=" + receiverCity
				+ ", receiverDistrict=" + receiverDistrict + ", receiverAddress=" + receiverAddress + ", receiverMobile=" + receiverMobile + ", receiverTelno="
				+ receiverTelno + ", receiverZip=" + receiverZip + ", logisticsType=" + logisticsType + ", invoiceType=" + invoiceType + ", invoiceTitle="
				+ invoiceTitle + ", invoiceContent=" + invoiceContent + ", buyerMessage=" + buyerMessage + ", sellerMemo=" + sellerMemo + ", sellerFlag="
				+ sellerFlag + ", postAmount=" + postAmount + ", codAmount=" + codAmount + ", extCodFee=" + extCodFee + ", otherAmount=" + otherAmount
				+ ", paid=" + paid + ", id_card_type=" + id_card_type + ", id_card=" + id_card + ", cust_data=" + cust_data + ", orderList=" + orderList + "]";
	}

}
